﻿using System.Runtime.InteropServices;

namespace LSA.Framework.Pinvoke
{
    /// <summary>
    /// Represents the SVDLIBC smat struct.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public unsafe struct SparseMatrix
    {
        public int rows;
        public int cols;
        /// <summary>
        /// Total non-zero entries.
        /// </summary>
        public int vals;
        /// <summary>
        /// For each col (plus 1), index of first non-zero entry.
        /// </summary>
        public int* pointr;
        /// <summary>
        /// For each nz entry, the row index.
        /// </summary>
        public int* rowind; 
        /// <summary>
        /// For each nz entry, the value.
        /// </summary>
        public double* value;
    };
}
